package dao;
import javebean.House;
import tool.MyhandleDbReflection;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class housedao {
        public static Object[] find() throws Exception {
            final Object[] house = MyhandleDbReflection.queryArray("select * from house", House.class);
            return house;
        }
        public static int in(House hous) throws SQLException {
            final int update = MyhandleDbReflection.update("insert into house values(null,?,?,?,?,?)",hous.getId(),
                    hous.getName(),hous.getTel(),hous.getAddress(),hous.getMoney(),hous.getState());
            return update;
        }
    //登录
    public static boolean login() throws SQLException {
        final boolean flag = MyhandleDbReflection.isAdmin();
        return flag;
    }

    //验证码
    public static String generateCode() {
        final String cap = MyhandleDbReflection.getCap();
        return cap;
    }

}
